
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<%@include file="/WEB-INF/taglibs/common/taglibs.jsp"%>
<head>
<title><spring:message code="admin.ordersettingnew.title" /></title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<link rel="stylesheet" href="<c:url value="/css/styles.css"/>" />
<script src="<c:url value="/javascripts/common.js"/>"></script>

<script language="JavaScript">
	//here you place the ids of every element you want.
    var ids=new Array('a1','a2','a3','thiscanbeanything');

    function switchid(id){
        hideallids();
        showdiv(id);
    }

    function hideallids(){
        //loop through the array and hide each element by id
        for (var i=0;i<ids.length;i++){
            hidediv(ids[i]);
        }
    }

    function hidediv(id) {
        //safe function to hide an element with a specified id
        if (document.getElementById) { // DOM3 = IE5, NS6
            document.getElementById(id).style.display = 'none';
        }
        else {
            if (document.layers) { // Netscape 4
                document.id.display = 'none';
            }
            else { // IE 4
                document.all.id.style.display = 'none';
            }
        }
    }

    function showdiv(id) {
        //safe function to show an element with a specified id

        if (document.getElementById) { // DOM3 = IE5, NS6
            document.getElementById(id).style.display = 'block';
        }
        else {
            if (document.layers) { // Netscape 4
                document.id.display = 'block';
            }
            else { // IE 4
                document.all.id.style.display = 'block';
            }
        }
    }

function showOptions(elem){
    //window.alert(elem);
    if(elem.options[elem.selectedIndex].value == "LIST"){
       showdiv('list_div');
    }else{
        hidediv('list_div');
    }

}

    </script>
</head>

<body><%@include file="../top_menu.jsp"%>>
<table width="100%">
	<tr>
		<td><c:import url="/WEB-INF/jsp/menu/view_orders_menu.jsp" />
		</td>
	</tr>
	<tr>
		<td><%@include file="/WEB-INF/jsp/include/messages.jsp"%>
		<br />
		</td>
	</tr>
</table>
<table border=0 cellpadding=0 cellspacing=0 width=100%>
	<tr>
		<td valign="top">

		<table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td>
				<h4><spring:message code="admin.ordersettingnew.label.newcustomfield" /></h4>
				</td>
				<td align="right">
				<h5><spring:message code="admin.ordersettingnew.label.chooselanguage" />: <select name="selectLanguage">
					<option value="1">English</option>
					<option value="2">Spanish</option>
				</select></h5>
				</td>
			</tr>
		</table>
		<form:form commandName="newFieldForm"
			action="view_orders_settings.htm" method="post">
			<table border="0" cellpadding="4" cellspacing="1">
				<tr>
					<td><spring:message code="admin.ordersettingnew.label.title" />:</td>
					<form:hidden path="id" />
					<td><form:input path="name" size="14" /></td>
				</tr>
				<tr>
					<td><spring:message code="admin.ordersettingnew.label.type" />:</td>
					<td><form:select id="type" path="type"
						onclick="showOptions(this)">
						<!--<c:forEach items="${types}" var="item" varStatus="i">
						    <form:option value="${i.index}">${item}</form:option>
						 </c:forEach>      -->
						<form:options items="${types}" />
					</form:select></td>
				</tr>
				<tr>
					<td><spring:message code="admin.ordersettingnew.label.active" /></td>
					<td><form:checkbox path="active" /></td>
				</tr>
			</table>
			<div id="list_div" style="display: none;">
			<table border="0" cellpadding="4" cellspacing="1">
				<tr>
					<td colspan="2"><spring:message code="admin.ordersettingnew.label.listoptions" /><br />
					<spring:message code="admin.ordersettingnew.label.addseparatevaluesbycomma" /></td>
				</tr>
				<tr>
					<td colspan="2"><form:input path="list" size="34" /></td>
				</tr>
			</table>
			</div>
			<table border="0" cellpadding="4" cellspacing="1">
				<tr>
					<c:choose>
						<c:when test="${empty param.edit}">
							<td>
							<button name="add"><spring:message code="admin.ordersettingnew.label.addfield" /></button>
							</td>
						</c:when>
						<c:otherwise>
							<td>
							<button name="add"><spring:message code="admin.ordersettingnew.label.savefield" /></button>
							</td>
						</c:otherwise>
					</c:choose>
					<td>
					<button name="cancel_add"><spring:message code="admin.ordersettingnew.label.cancel" /></button>
					</td>
				</tr>
			</table>
		</form:form> <script language="javascript" type="text/javascript">showOptions(document.getElementById('type'));</script>
		</td>
	</tr>
</table><%@include file="/WEB-INF/jsp/include/footer.jsp"%>
</body>
</html>